home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / fortran / peekpo.com / MACHIDL.FOR < prev    next >
Encoding:
Text File  |  1990-10-16  |  898 b   |  28 lines

  1.       PROGRAM MACHINE_ID
  2.       integer*4 laddr/z'FFFF000E'/
  3.       integer*2 ibyte
  4. c
  5. c     This program is a demonstration of an all-Fortran PEEK routine.
  6. c     It will return the machine ID byte from address FFFF:000E;
  7. c     this location tells you whether your machine is a PC, an XT,
  8. c     or an AT.
  9. c
  10.       call peekb(laddr,ibyte)
  11.       print 20, ibyte
  12.    20 format (' ibyte = ',z2)
  13. c
  14.       stop
  15.       end
  16.       SUBROUTINE PEEKB(LADDR,IBYTE)
  17.       integer*4 laddr                   ! Address of byte to get
  18.       integer*2 ibyte                   ! Value of that location
  19.       call peekb0(carg(laddr),ibyte)    ! CARG function passes by value
  20.       ibyte=iand(ibyte,255)             ! Trim off extra byte
  21.       return
  22.       end
  23.       SUBROUTINE PEEKB0(I,IBYTE)
  24.       integer*2 i,ibyte
  25.       ibyte=i                           ! Get what's there
  26.       return
  27.       end
  28.